Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not throw when there's no sidenav. #270

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

hansl
Copy link
Contributor

@hansl hansl commented Apr 7, 2016

Fixes #269.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 7, 2016
@hansl
Copy link
Contributor Author

hansl commented Apr 7, 2016

@jelbourn @jeffbcross

@@ -286,9 +281,6 @@ export class MdSidenavLayout implements AfterContentInit {
*/
private _validateDrawers() {
this._start = this._end = null;
if (this._sidenavs.length === 0) {
throw new MdMissingSidenavException();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test? While the code isn't explicitly throwing an exception when a sidenav is missing, having a test would guard against accidentally throwing an error if the sidenav is missing (such as, for example, a null dereference).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Donerino.

@hansl hansl force-pushed the sidenav-bug branch 2 times, most recently from a488238 to 4488ab1 Compare April 7, 2016 16:36
@jelbourn
Copy link
Member

jelbourn commented Apr 7, 2016

LGTM

@jelbourn jelbourn merged commit cc2b223 into angular:master Apr 7, 2016
andrewseguin pushed a commit to andrewseguin/components that referenced this pull request Oct 15, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MdSidenavlayout should not throw when no MdSidenav is present
3 participants